﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.DynamicData;

namespace Fatec.ControleEstoque.Attributes
{
    /// <summary>
    /// Summary description for ExtensionMethods
    /// </summary>
    public static class ExtensionMethods
    {
        public static Boolean IsHidden(this MetaColumn column, PageTemplate currentPage)
        {
            var hideIn = column.Attributes.OfType<HideColumnInAttribute>().DefaultIfEmpty(new HideColumnInAttribute()).First() as HideColumnInAttribute;
            return hideIn.PageTemplates.Contains(currentPage);
        }
    }
}